﻿@namespace BootstrapBlazor.Components
@typeparam TValue
@inherits UploadBase<TValue>

@if (IsShowLabel)
{
    <label class="form-label" required="@Required" for="@Id">@DisplayText</label>
}
<div @attributes="@AdditionalAttributes" class="@ClassString" @ref="UploaderElement">
    <div class="input-group">
        <input type="text" class="@InputValueClassString" id="@Id" disabled="@DisabledString" readonly placeholder="@PlaceHolder" value="@GetFileName(CurrentFile)" />
        @if (ShowDeleteButton)
        {
            <Button class="@RemoveButtonClassString" IsDisabled="@IsDeleteButtonDisabled" Icon="@DeleteButtonIcon" Text="@DeleteButtonText" OnClick="@OnDeleteFile" />
        }
        <Button class="@BrowserButtonClassString" IsDisabled="@IsDisabled" Icon="@BrowserButtonIcon" Text="@BrowserButtonText" OnClick="@OnFileBrowser" />
    </div>
    <InputFile AdditionalAttributes="@GetUploadAdditionalAttributes()" OnChange="OnFileChange" />
</div>
